import request from '@/utils/request';

export function getPickplanbillList(data) {
	return request({
		url: '/purchase/pickplanbill/list',
		method: 'get',
		data,
	});
}

export function deletePickplanbill(id) {
	return request({
		url: `/purchase/pickplanbill/${id}`,
		method: 'delete',
	});
}

export function editPickplanbill(data) {
	return request({
		url: `/purchase/pickplanbill/edit`,
		method: 'put',
		data,
	});
}

export function addPickplanbill(data) {
	return request({
		url: `/purchase/pickplanbill/add`,
		method: 'post',
		data,
	});
}

// 获取裁片数据
export function getCuttingList(data) {
	return request({
		url: `/purchase/pickplanbill/cuttinglist`,
		method: 'get',
		data,
	});
}

export function getMaterialbillList(data) {
	return request({
		url: `/purchase/materialbill/list`,
		method: 'get',
		data,
	});
}

export function getPickplanbill(id) {
	return request({
		url: `/purchase/pickplanbill/${id}`,
		method: 'get',
	});
}

export function getAccessories(pickPlanId) {
	return request({
		url: `/purchase/pickplanbill/getAccessories`,
		method: 'put',
		data: { pickPlanId },
	});
}

export function getPersonAmountList() {
	return request({
		url: `/purchase/productManager/list`,
		method: 'get',
		data: { type: 1, pageNum: 1, pageSize: 100 },
	});
}

export const getEmbroiderySummary = (data) => {
	return request({
		url: '/purchase/pickplanbill/embroidery/summary',
		method: 'get',
		data,
	});
};

export function getEmbroideryProductList(data) {
	return request({
		url: `/purchase/pickplanbill/product/list`,
		method: 'get',
		data,
	});
}

export function getEmbroideryRetractionList(data) {
	return request({
		url: `/embroideryRetractionRecord/list`,
		method: 'get',
		data,
	});
}

export function getRetractionProductList(data) {
	return request({
		url: `/embroideryRetractionRecord/product/list`,
		method: 'get',
		data,
	});
}

export function getRetractionCuttingList(data) {
	return request({
		url: `/embroideryRetractionRecord/cutting/list`,
		method: 'get',
		data,
	});
}

export function addEmbroideryRetractionRecord(data) {
	return request({
		url: `/embroideryRetractionRecord/add`,
		method: 'post',
		data,
	});
}

export function editEmbroideryRetractionRecord(data) {
	return request({
		url: `/embroideryRetractionRecord/edit`,
		method: 'put',
		data,
	});
}

export function deleteEmbroideryRetractionRecord(id) {
	return request({
		url: `/embroideryRetractionRecord/${id}`,
		method: 'delete',
	});
}

export function embroideryRetractionAudit(data) {
	return request({
		url: `/embroideryRetractionRecord/audit`,
		method: 'post',
		data,
	});
}

export function getWorkOrderList(cuttingCode) {
	return request({
		url: `/embroideryRetractionRecord/workOrder/list`,
		method: 'get',
		data: { cuttingCode },
	});
}

export const getRetractionRecordSummary = (data) => {
	return request({
		url: '/embroideryRetractionRecord/summary',
		method: 'get',
		data,
	});
};

export function addEmbroideryInspect(data) {
	return request({
		url: `/embroideryInspect/add`,
		method: 'post',
		data,
	});
}

export function copyEmbroideryRetractionRecord(data) {
	return request({
		url: `/embroideryRetractionRecord/copy/add`,
		method: 'post',
		data,
	});
}

export function getWorkOrderInfo(data) {
	return request({
		url: `/embroideryRetractionRecord/workOrderInfo`,
		method: 'get',
		data,
	});
}

export function getEmbroideryInspectInfo(embroideryId) {
	return request({
		url: `/embroideryInspect/info/${embroideryId}`,
		method: 'get',
	});
}